#pragma once

#include "myEigen.h"
#include "tgaimage.h"

namespace rst {

struct Vertex {
	myEigen::Vector4f vertex;
	TGAColor vertexColor;
	myEigen::Vector4f normal;

	Vertex& operator=(const Vertex& v) {
		if (this != &v) {
			vertex = v.vertex;
			vertexColor = v.vertexColor;
			normal = v.normal;
		}
		return *this;
	}
};

/// linear interpolation
inline Vertex lerp(const Vertex& v1, const Vertex& v2, const float t) {
	return Vertex{
		lerp(v1.vertex, v2.vertex, t), 
		ColorLerp(v1.vertexColor, v2.vertexColor, t),
		lerp(v1.normal, v2.normal, t)
	};
}

}
